This repository has been archived by the owner on Mar 17, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is about updating
botkit
to the latest version. (JIRA ticket).Botkit4 has a different structure, so this is what has been done in this PR:
adapter
(for this project it isbotbuilder-adapter-slack
)ngrok
, theREDIRECT_URI
environment variable has to be updated each time you close the connection. (And add this variable to.env
if you don't have it, it is a required param).adapter
class with the created options.Botkit
core class controller with the adapter, in addition to an internal memorystorage
(see below in DB paragraph for details).To see if your bot is installed properly:
npm run dev
as usualngrok http 3000
(no changes here)Then go to the
install
endpointhttp://localhost:3000/install
and you should see your slack app requesting authorisation to continue. If you agree it should redirect you to theREDIRECT_URI
, and you will see the message :Success! Bot installed
.At the moment we are only storing a few oauth tokens in the internal storage. But the next thing to solve is the DB storage for skills and users. As said in the docs: In v4 of Botkit, the storage system is currently only used to store and retrieve the conversation state between turns. Other than this, Botkit will no longer be providing an interface for connecting to or using databases. Developers should build their own database abstractions.
P.S: instead of
server.js
we are usingbotController.webserver
: it looks like it is recommended to use this express server, which is shipped with the controller.